﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SectionInfoEdit.ascx.cs"
    Inherits="ExaminationSys.View.Section.SectionInfoEdit" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script type="text/javascript" language="javascript">
    var setID = function (param) {
        try {

            var hidden = document.getElementById('<%=IDHidden.ClientID %>');
            hidden.value = param;
        } catch (e) {
            alert(e);
        }
    };
</script>
<input type="hidden" id="IDHidden" runat="server" />
<ext:Window ID="SectionInfoEditWindow" runat="server" Icon="Group" Title="栏目设置" Width="300"
    Height="386" AutoShow="false" Modal="true" Hidden="true" Layout="Fit">
    <Items>
        <ext:FormPanel ID="SectionInfoEditPanel" runat="server" Icon="ChartOrganisation"
            DefaultAnchor="95%" Padding="5" BodyPadding="10">
            <Items>
                <ext:NumberField ID="OrderIndex" runat="server" FieldLabel="排序"  />
                <ext:TextField ID="Name" AllowBlank="false" runat="server" FieldLabel="模块名称" />
                
                <ext:TextField ID="Img" AllowBlank="true" runat="server" FieldLabel="图片" />
                <ext:FileUploadField Id="Imgload" AllowBlank="true" runat ="server" 
                    EmptyText="请选择文件"
                    FieldLabel="上传图片"
                    Icon="ImageAdd"
                    ButtonText="浏览"
                    Regex="^.+\.((jpg)|(jpeg)|(gif))$"
                    RegexText="文件格式不正确，建议后缀名(jpg)|(jpeg)|(gif)">
                </ext:FileUploadField>

                <ext:LinkButton ID="reUploadImgLBtn" runat="server" Visible="false" Text="重新上传">
                    <DirectEvents>
                        <Click OnEvent="reUploadImgLBtn_Click" />
                     </DirectEvents>
                </ext:LinkButton>
                <ext:ComboBox ID="SectionType" AllowBlank="true" runat="server" FieldLabel="类型" EmptyText="请选择类型..."  AnchorHorizontal="100%">
                    <Items>
                        <ext:ListItem Text="学习栏目" Value="1" />
                        <ext:ListItem Text="信息栏目" Value="4" />
                        <ext:ListItem Text="外链接" Value="2" />
                        <ext:ListItem Text="下载板块" Value="3" />

                    </Items>
                </ext:ComboBox>
            </Items>
        </ext:FormPanel>
    </Items>
    <Buttons>
        <ext:Button ID="SaveButton" runat="server" Text="保存" Icon="BulletGo">
            <DirectEvents>
                <Click OnEvent="SaveSectionInfo" Failure="Ext.MessageBox.alert('Saving failed', 'Error during ajax event');" Success="#{StoreSectionInfo}.reload();">
                </Click>
            </DirectEvents>
        </ext:Button>
        <ext:Button ID="CancelButton" runat="server" Text="取消" Icon="Cancel">
            <Listeners>
                <Click Handler="#{SectionInfoEditWindow}.hide(null);" />
            </Listeners>
        </ext:Button>
    </Buttons>
</ext:Window>
